<?php
//声明文件解析的编码格式
header('content-type:text/html;charset=utf-8');

function dbcon()
{

		$servername = SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT;
		$username = SAE_MYSQL_USER;
		$password = SAE_MYSQL_PASS;
		$db=SAE_MYSQL_DB;

		// 创建连接
		$conn = new mysqli($servername, $username, $password,$db);

		// 检测连接
		if ($conn->connect_error) {
		    die("连接失败: " . $conn->connect_error);
		} 		

		$conn->query('set names utf8');


        return $conn;


}